CREATE DATABASE  IF NOT EXISTS `medicinamuncii` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_romanian_ci */;
USE `medicinamuncii`;
-- MySQL dump 10.13  Distrib 5.1.40, for Win32 (ia32)
--
-- Host: 127.0.0.1    Database: medicinamuncii
-- ------------------------------------------------------
-- Server version	5.1.51-community

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `companyinsult`
--

DROP TABLE IF EXISTS `companyinsult`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `companyinsult` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `CompanyID` int(11) NOT NULL,
  `InsultID` int(11) NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_Company_CompanyInsults` (`CompanyID`),
  KEY `FK_Insult_CompanyInsult` (`InsultID`),
  CONSTRAINT `FK_Insult_CompanyInsult` FOREIGN KEY (`InsultID`) REFERENCES `insult` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_Company_CompanyInsults` FOREIGN KEY (`CompanyID`) REFERENCES `company` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `companyinsult`
--

LOCK TABLES `companyinsult` WRITE;
/*!40000 ALTER TABLE `companyinsult` DISABLE KEYS */;
/*!40000 ALTER TABLE `companyinsult` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `examinationtype`
--

DROP TABLE IF EXISTS `examinationtype`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `examinationtype` (
  `ID` int(11) NOT NULL,
  `Name` varchar(45) COLLATE utf8_romanian_ci NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `examinationtype`
--

LOCK TABLES `examinationtype` WRITE;
/*!40000 ALTER TABLE `examinationtype` DISABLE KEYS */;
/*!40000 ALTER TABLE `examinationtype` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `company`
--

DROP TABLE IF EXISTS `company`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `company` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(60) COLLATE utf8_romanian_ci NOT NULL,
  `AddressID` int(11) DEFAULT NULL,
  `ContactPersonID` int(11) DEFAULT NULL,
  `Profile` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  `Unit` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_Address_Company` (`AddressID`),
  CONSTRAINT `FK_Address_Company` FOREIGN KEY (`AddressID`) REFERENCES `address` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `company`
--

LOCK TABLES `company` WRITE;
/*!40000 ALTER TABLE `company` DISABLE KEYS */;
/*!40000 ALTER TABLE `company` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `recomandation`
--

DROP TABLE IF EXISTS `recomandation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `recomandation` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `recomandation`
--

LOCK TABLES `recomandation` WRITE;
/*!40000 ALTER TABLE `recomandation` DISABLE KEYS */;
/*!40000 ALTER TABLE `recomandation` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `insult`
--

DROP TABLE IF EXISTS `insult`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `insult` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) COLLATE utf8_romanian_ci NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `insult`
--

LOCK TABLES `insult` WRITE;
/*!40000 ALTER TABLE `insult` DISABLE KEYS */;
/*!40000 ALTER TABLE `insult` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `person`
--

DROP TABLE IF EXISTS `person`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `person` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `FirstName` varchar(45) COLLATE utf8_romanian_ci NOT NULL,
  `LastName` varchar(45) COLLATE utf8_romanian_ci NOT NULL,
  `AddressID` int(11) DEFAULT NULL,
  `CNP` varchar(10) COLLATE utf8_romanian_ci DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_Address_Person` (`AddressID`),
  CONSTRAINT `FK_Address_Person` FOREIGN KEY (`AddressID`) REFERENCES `address` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `person`
--

LOCK TABLES `person` WRITE;
/*!40000 ALTER TABLE `person` DISABLE KEYS */;
/*!40000 ALTER TABLE `person` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `examination`
--

DROP TABLE IF EXISTS `examination`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `examination` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ExaminationTypeID` int(11) NOT NULL,
  `MedicalAdviceID` int(11) NOT NULL,
  `EmployeeID` int(11) NOT NULL,
  `Date` datetime NOT NULL,
  `Recomandations` varchar(100) COLLATE utf8_romanian_ci DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_Employee_Examination` (`EmployeeID`),
  KEY `FK_MedicalAdvice_Examination` (`MedicalAdviceID`),
  KEY `FK_ExaminationType_Examination` (`ExaminationTypeID`),
  CONSTRAINT `FK_Employee_Examination` FOREIGN KEY (`EmployeeID`) REFERENCES `employee` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_ExaminationType_Examination` FOREIGN KEY (`ExaminationTypeID`) REFERENCES `examinationtype` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_MedicalAdvice_Examination` FOREIGN KEY (`MedicalAdviceID`) REFERENCES `medicaladvice` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `examination`
--

LOCK TABLES `examination` WRITE;
/*!40000 ALTER TABLE `examination` DISABLE KEYS */;
/*!40000 ALTER TABLE `examination` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `address`
--

DROP TABLE IF EXISTS `address`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `address` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Street` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  `Number` int(11) DEFAULT NULL,
  `Details` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  `City` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  `Country` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  `ZipCode` int(11) DEFAULT NULL,
  `Phone` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  `Fax` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  `Email` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `address`
--

LOCK TABLES `address` WRITE;
/*!40000 ALTER TABLE `address` DISABLE KEYS */;
/*!40000 ALTER TABLE `address` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `employee`
--

DROP TABLE IF EXISTS `employee`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employee` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `CompanyID` int(11) NOT NULL,
  `PersonID` int(11) NOT NULL,
  `Number` int(11) DEFAULT NULL,
  `Occupation` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  `Position` varchar(45) COLLATE utf8_romanian_ci DEFAULT NULL,
  `WorkPlace` varchar(60) COLLATE utf8_romanian_ci DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_Company_Employee` (`CompanyID`),
  KEY `FK_Person_Employee` (`PersonID`),
  CONSTRAINT `FK_Company_Employee` FOREIGN KEY (`CompanyID`) REFERENCES `company` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_Person_Employee` FOREIGN KEY (`PersonID`) REFERENCES `person` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `employee`
--

LOCK TABLES `employee` WRITE;
/*!40000 ALTER TABLE `employee` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `medicaladvice`
--

DROP TABLE IF EXISTS `medicaladvice`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `medicaladvice` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) COLLATE utf8_romanian_ci NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `medicaladvice`
--

LOCK TABLES `medicaladvice` WRITE;
/*!40000 ALTER TABLE `medicaladvice` DISABLE KEYS */;
/*!40000 ALTER TABLE `medicaladvice` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `examinationrecomandation`
--

DROP TABLE IF EXISTS `examinationrecomandation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `examinationrecomandation` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ExaminationID` int(11) NOT NULL,
  `RecomandationID` int(11) NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_Examination_ExaminationRecomandation` (`ExaminationID`),
  KEY `FK_Recomandation_ExaminationRecomandation` (`RecomandationID`),
  CONSTRAINT `FK_Examination_ExaminationRecomandation` FOREIGN KEY (`ExaminationID`) REFERENCES `examination` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_Recomandation_ExaminationRecomandation` FOREIGN KEY (`RecomandationID`) REFERENCES `recomandation` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_romanian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `examinationrecomandation`
--

LOCK TABLES `examinationrecomandation` WRITE;
/*!40000 ALTER TABLE `examinationrecomandation` DISABLE KEYS */;
/*!40000 ALTER TABLE `examinationrecomandation` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2010-10-08  0:34:17
